/****************************************************
 * 创建人:   robin
 * 创建时间: 2023/9/1.001 11:08
 * 项目名称: cpy
 * 文件名称: PsdpResponseData.java
 * 文件描述: 
 *
 * All rights Reserved, Designed By 德品软件
 * @Copyright:2023-2023
 *
 ********************************************************/
package com.dp.feign.vo.response;

import lombok.Data;

/**
 * 包名称：com.dp.feign.vo.response
 * 类名称：PsdpResponseData
 * 类描述：
 * 创建人： robin
 * 创建时间：2023/9/1.001 11:08
 */
@Data
public class PsdpResponseData<T> {
    
    private Boolean success;
    private String message;
    private Integer code;
    private transient T result;
    private Long timestamp;
    
    private PsdpResponseData(Boolean success, String message, Integer code, T result, Long timestamp) {
        this.success = success;
        this.message = message;
        this.code = code;
        this.result = result;
        this.timestamp = timestamp;
    }
    
    public static <T> PsdpResponseData<T> handleError(Boolean success, String message, Integer code, T result, Long timestamp) {
        PsdpResponseData<T> PsdpResponseData = new PsdpResponseData<>(success, message, code, result, timestamp);
        return PsdpResponseData;
    }
    
}
